/*
 *  RendererGLES1.h
 *  SypXIPhone
 *
 *  Created by Luv Khemani on 5/11/10.
 *  Copyright 2010 Luv Khemani. All rights reserved.
 *
 */

#pragma once
#ifndef SYPX_RENDERER_GLES1
#define SYPX_RENDERER_GLES1

#include "Base.h"
#include "Types.h"
#include "Renderer.h"

namespace SypX
{
	
	class SYPXAPI RendererGLES1 : public Renderer
	{
	public:
		///Constructor for OpenGL ES1 Renderer
		RendererGLES1();
		///Deconstructor for OpenGL ES1 Renderer
		virtual ~RendererGLES1();
		///Inits the Renderer. Usually does things like initialising Rendering API, setting viewport
		virtual void init(UInt width, UInt height);
		///Clears the screen
		virtual void clearScreen(bool color=true, bool depth=true);
		///Sets the clear screen color
		virtual void setClearScreenColor(const Vec4& color);
		///Draws a mesh 
		virtual void drawMesh(MeshInstance* mi);
		///Creates and allocates the texture on GPU. (Usually called by Texture class itself and not directly)
		virtual void createTexture(Texture* tex);
		///Deletes the texture from the GPU
		virtual void deleteTexture(Texture* tex);
	private:
		///The framebuffer and color renderbuffer for rendering onto (Uses extensions on IPhone, may not work on Android)		
		UInt framebuffer, renderbuffer, depthbuffer;
	};
}

#endif

